<template>
  <el-input v-model="input" :placeholder="placeholder" @change="inputChange"></el-input>
</template>

<script>
export default {
  name: 'search',
  data () {
    return {
      input: ''
    }
  },
  methods: {
    inputChange () {
      this.$store.dispatch(this.storeFunction, this.input)
    }
  },
  props: {
    'placeholder': String,
    'storeFunction': String
  },
  mounted () {
    this.$store.dispatch(this.storeFunction, '')
  }
}
</script>

<style scoped>

</style>
